use crate::model::LibImport;
use swc_ecma_ast::*;

pub trait CommonModuleTrait {
    // 根据给定的父节点，初始化子节点
    fn init_sub_node(
        &mut self,
        parent_node: &Option<ObjectLit>,
        sub_node_name: &str,
        err_msg: &str,
        new_content: &str,
    ) -> Result<(), Box<dyn std::error::Error>>;

    fn init_import(&mut self, import_def: &LibImport) -> Result<(), Box<dyn std::error::Error>>;
}
